<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>故障工单列表</title>
		<style>
		#organizesTree {
			margin-top: 10px;
			border: 1px solid #617775;
			background: #f0f6e4;
			min-width: 180px;
			max-height: 400px;
			overflow-y: scroll;
			overflow-x: auto;
		}
		</style>
		<link rel="stylesheet" type="text/css"
			href="<%=request.getContextPath()%>/css/common.css" />
		<link rel="stylesheet" type="text/css"
			href="<%=request.getContextPath()%>/css/tag.css" />
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/jquery-1.7.2.js">
		</script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js">
		</script>
		
		<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/zTreeStyle/zTreeStyle.css" />	
		<link type="text/css" href="<%=request.getContextPath()%>/js/jquery-ui-1.8.21.custom/css/smoothness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.ztree.core-3.1.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.ztree.excheck-3.1.min.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-ui-1.8.21.custom/js/jquery-ui-1.8.21.custom.min.js">
		</script>
		<script type="text/javascript">
			$(document).ready(function(){
				
	         });
	         
	        // 翻页
			function pageSub(currentPage) {
				var reg = /^\d*?$/;
				var total = ${page.totalPages};
				if(reg.test(currentPage)){
				 	if(currentPage > total){
				 		currentPage = total;
					 }
					 $("#currentPage").val(currentPage);
					 $('#form1').submit();
				} else {
					alert("请输入数字!");
				}
			}
			// 查询
			function submitForm(){
				var flag = true;				
				var date = $.trim($("#date1").val());
				var workOrder = $.trim($("#workOrder1").val());
				//var reg = /^[\s\dA-Za-z\u4E00-\u9FA5]+$/;
				//验证
				if(flag){
					//赋值
					$("#currentPage").val(0);
					$("#date").val(date);
					$("#workOrder").val(workOrder);
					//提交
					$('#form1').submit();
				}
			}
		</script>
	</head>
	<body>
	<jsp:include page="../common/top.jsp"></jsp:include>
		<!-- 顶部start -->
		<div id="main">
			<div class="body">
			<jsp:include page="../common/nav.jsp"></jsp:include>
				<!-- 主体 -->
				<div class="main_body">
					<form id="form1" action="getFaults.action" method="post">
						<table class="condition bg1"
							style="width: 100%; font-size: 14px; font-weight: bold; color: #000000;"
							align="center">
							<tr>
								<td style="height: 40px; width: 8%; text-align:right;">
									<label>
										日期：
									</label>
								</td>
								<td style="height: 40px; width: 15%;">
									<input type="text" id="date1" class="text Wdate" value="${date}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"  style="text-valign:middle; line-height:23px;" />
								</td>
								<td style="height: 40px; width: 8%; text-align:right;">
									<label>
										工单号：
									</label>
								</td>
								<td style="height: 40px; width: 15%;">
									<input type="text" id="workOrder1" class="text" value="${workOrder}" style= "text-valign:middle; line-height:23px; " />
								</td>
								<td style="height: 40px;  text-align: left;" colspan="2">
									<input name="button" type="button" class="btn-title" value="搜索"
										onclick="submitForm();" />
								</td>
								
								<td style="height: 40px; text-align: right;" valign="middle">
									<input type="button" class="btn-title" value="批量导入" onclick="window.location.href='jsp/unit/uploadExcelPage.jsp';" />
									&nbsp;&nbsp;&nbsp;
								</td>
								
								<td style="height: 40px; text-align: right;" valign="middle">
									<input type="button" class="btn-title" value="新增" onclick="window.location.href='initAddFault.action';" />
									&nbsp;&nbsp;&nbsp;
								</td>
							</tr>
						</table>
						<input type="hidden" id="currentPage" name="currentPage" />
						<input type="hidden" id="date" name="date" />
						<input type="hidden" id="workOrder" name="workOrder" />
					</form>

					<div id="list_div">
						<table class="table_list" style="width: 100%; ">
							<tr class="bg">
								<th>
									序号
								</th>
								<th>
									日期
								</th>
								<th>
									线路
								</th>
								<th>
									工单号
								</th>
								<th>
									设备类型
								</th>
								<th>
									故障地点
								</th>
								<th>
									维修人员
								</th>
								<th>
									维修班组
								</th>
								<th>
									问题跟踪情况
								</th>
								<th>
									故障维修方式
								</th>
								<th>
									操作
								</th>
							</tr>
							<s:iterator value="faults" status="status">
								<tr>
									<td>
										<s:property value="(#status.index + 1)"/>
									</td>
									<td>
										${date}
									</td>
									<td>
										${lineIdText}
									</td>
									<td>
									  	${workOrder}
									</td>
									<td>
										${deviceTypeText}
									</td>
									<td>
									   	${faultLocation}
									</td>
									<td>
									   	${repairMan}
									</td>
									<td>
									 	${repairTeam}
									</td>
									<td>
										 ${problemTrack}
									</td>
									<td>
										 ${repairMethodText}
									</td>
									<td>
								    	<a href="initModifyFault.action?fault.id=${id}" title="编辑">
								    		<img src="<%=request.getContextPath()%>/images/modify.gif" alt="编辑" align="absmiddle" />
										</a>
										<a href="detailFault.action?fault.id=${id}" title="详情" onclick="">
											<img src="<%=request.getContextPath()%>/images/detail.gif" alt="详情" align="absmiddle" />
										</a>
								    	<a href="deleteFault.action?fault.id=${id}" title="删除" onclick="return confirm('确定删除该条记录吗？');">
								    		<img src="<%=request.getContextPath()%>/images/delete.gif" alt="删除" align="absmiddle" />
										</a>
									</td>
								</tr>
							</s:iterator>
						</table>
						<!-- 分页 -->
						<jsp:include page="/jsp/common/page.jsp"></jsp:include>
					</div>
				</div>
			</div>
			</div>
		<jsp:include page="/jsp/common/bottom.jsp"></jsp:include>
	</body>
</html>
